package com.pro.beans;
import java.text.SimpleDateFormat;
import java.util.Date;








import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pro.entity.AlarmType;
import com.pro.entity.ResultType;
public class Alarm{
	private GridPersons gridPersons;
	
	public GridPersons getGridPersons() {
		return gridPersons;
	}
	public void setGridPersons(GridPersons gridPersons) {
		this.gridPersons = gridPersons;
	}
	private Integer days;
	
	public Integer getDays() {
		return days;
	}
	public void setDays(Integer days) {
		this.days = days;
	}
	private String count;
	
		public String getCount() {
		return count;
	}
	public void setCount(String count) {
		this.count = count;
	}
		private Integer id;
		public Integer getId(){
			return this.id;
		}
		public void setId(Integer id){
			this.id=id;
		}
		private String company_name;
		public String getCompany_name(){
			return this.company_name;
		}
		public void setCompany_name(String company_name){
			this.company_name=company_name;
		}
		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm") 
		private Date alarm_time;
//		@DateTimeFormat(pattern="yyyy/MM/dd hh:mm:ss") 
		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm") 
		@JsonFormat(pattern="yyyy-MM-dd HH:mm")
		public Date getAlarm_time(){
			return this.alarm_time;
		}
		
		public String getAlarmTimeString(){
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ss HH:mm");
			if(this.getAlarm_time()==null)return "";
			return sdf.format(this.getAlarm_time());
		}
		public void setAlarm_time(Date alarm_time){
			this.alarm_time=alarm_time;
		}
		private String type;
		public String getType(){
			return this.type;
		}
		public void setType(String type){
			this.type=type;
		}
		private String p_desc;
		public String getP_desc(){
			return this.p_desc;
		}
		public void setP_desc(String p_desc){
			this.p_desc=p_desc;
		}
		private String result;
		public String getResult(){
			return this.result;
		}
		public void setResult(String result){
			this.result=result;
		}
		private Integer del_flag;
		public Integer getDel_flag(){
			return this.del_flag;
		}
		public void setDel_flag(Integer del_flag){
			this.del_flag=del_flag;
		}
		private String alarm_address;
		public String getAlarm_address(){
			return this.alarm_address;
		}
		public void setAlarm_address(String alarm_address){
			this.alarm_address=alarm_address;
		}
		private String alarm_point;
		public String getAlarm_point(){
			return this.alarm_point;
		}
		public void setAlarm_point(String alarm_point){
			this.alarm_point=alarm_point;
		}
		private String legal_person;
		public String getLegal_person(){
			return this.legal_person;
		}
		public void setLegal_person(String legal_person){
			this.legal_person=legal_person;
		}
		private String principal_man;
		public String getPrincipal_man(){
			return this.principal_man;
		}
		public void setPrincipal_man(String principal_man){
			this.principal_man=principal_man;
		}
		private String fire_control_tel;
		public String getFire_control_tel(){
			return this.fire_control_tel;
		}
		public void setFire_control_tel(String fire_control_tel){
			this.fire_control_tel=fire_control_tel;
		}
		private String support_unit;
		private String support_tel;
		private String error_type;
		
		public String getError_type() {
			return error_type;
		}
		public void setError_type(String error_type) {
			this.error_type = error_type;
		}
		public String getSupport_unit() {
			return support_unit;
		}
		public void setSupport_unit(String support_unit) {
			this.support_unit = support_unit;
		}
		public String getSupport_tel() {
			return support_tel;
		}
		public void setSupport_tel(String support_tel) {
			this.support_tel = support_tel;
		}
		private String device_made_unit;
		public String getDevice_made_unit(){
			return this.device_made_unit;
		}
		public void setDevice_made_unit(String device_made_unit){
			this.device_made_unit=device_made_unit;
		}
		private Integer status;
		public Integer getStatus(){
			return this.status;
		}
		public void setStatus(Integer status){
			this.status=status;
		}
		private String grid_person_no;
		public String getGrid_person_no(){
			return this.grid_person_no;
		}
		public void setGrid_person_no(String grid_person_no){
			this.grid_person_no=grid_person_no;
		}
		private String grid_tel;
		public String getGrid_tel(){
			return this.grid_tel;
		}
		public Integer grid_id;
		
		public Integer getGrid_id() {
			return grid_id;
		}
		public void setGrid_id(Integer grid_id) {
			this.grid_id = grid_id;
		}
		public void setGrid_tel(String grid_tel){
			this.grid_tel=grid_tel;
		}
		private String model;
		
		public String getModel() {
			return model;
		}
		public void setModel(String model) {
			this.model = model;
		}
		private String inspect_point;
		public String getInspect_point(){
			return this.inspect_point;
		}
		public void setInspect_point(String inspect_point){
			this.inspect_point=inspect_point;
		}
		private String inspect_person;
		public String getInspect_person(){
			return this.inspect_person;
		}
		public void setInspect_person(String inspect_person){
			this.inspect_person=inspect_person;
		}
		private Integer inspect_person_id;
		public Integer getInspect_person_id(){
			return this.inspect_person_id;
		}
		public void setInspect_person_id(Integer inspect_person_id){
			this.inspect_person_id=inspect_person_id;
		}
		private String error_desc;
		public String getError_desc(){
			return this.error_desc;
		}
		public void setError_desc(String error_desc){
			this.error_desc=error_desc;
		}
		private Person person;
		
		public Person getPerson() {
			return person;
		}
		public void setPerson(Person person) {
			this.person = person;
		}
		public String getTypeName(){
			for(AlarmType alarmType:AlarmType.values()){
				if(alarmType.getId().equals(this.type))
					return alarmType.getName();
			}
			return "";
		}
		public String getResultName(){
			for(ResultType alarmType:ResultType.values()){
				if(alarmType.getId().equals(this.result))
					return alarmType.getName();
			}
			return "";
		}
	}